/**
 * Created with IntelliJ IDEA.
 * User: teddy zhang
 * Date: 2015-07-28
 * Time: 15:26
 */


define(function (require, exports, module) {
    
    var rk = require('rk');
    $.widget('rk.markingReportDetail', {

        _create: function () {
            var me = this;
            var elem = me.element;
            var opt = me.options;
            opt.randomkey = Math.random() + '';

        },

        _render: function (data) {
            var me = this;
            var elem = me.element;
            var opt = me.options;
            elem.html(rk.templateText(require('oa/tmpl/wanxue/tpl_marking_report_detail.tpl'), data));
        },

        _bind: function () {
            var me = this;
            var elem = me.element;
            var opt = me.options;


            $('#business_capability').on('click', function (event) {
                var $this = $(this);
                event.preventDefault();
                $this.addClass('active').siblings().removeClass('active');

                var userId = me.data.customerId;
                elem.find('.tab2').hide();
                elem.find('.tab1').beLoading({
                    size: 'large'
                });
                elem.find('.tab1').show();
                rk.get('/json/crm_wanxue/capability-report.action', {uid: userId}, function (data) {
                    if (data.status === 0) {
                        data = data.data.capability;

                        var nameUNSet = '未设置';
                        var targetNUMSet = 0;
                        var targetTotal = 20;
                        var diamondTargetTotal = 40;

                        $.each(data, function (key, item) {
                            switch (key) {
                                case 'recruit':
                                case 'member':
                                case 'lecture':
                                case 'pro':
                                case 'train':
                                case 'pub':
                                case 'internet':
                                case 'capability':
                                case 'wxt':
                                    item.approver = item.approver != -1 ? item.approver : nameUNSet;
                                    item.trainer = item.trainer != -1 ? item.trainer : nameUNSet;
                                    item.recite = item.recite > 0 ? item.recite : targetNUMSet;
                                    item.recitePCT = ((parseFloat(item.recite) / targetTotal).toFixed(2)) * 100
                                    if (item.recitePCT > 100)item.recitePCT = 100;
                                    item.mixed = item.mixed > 0 ? item.mixed : targetNUMSet;
                                    item.mixedPCT = ((parseFloat(item.mixed) / targetTotal).toFixed(2)) * 100
                                    if (item.mixedPCT > 100)item.mixedPCT = 100;
                                    break;
                                case 'diamond':
                                    item.approver = item.approver != -1 ? item.approver : nameUNSet;
                                    item.trainer = item.trainer != -1 ? item.trainer : nameUNSet;
                                    item.recite = item.recite > 0 ? item.recite : targetNUMSet;
                                    item.recitePCT = ((parseFloat(item.recite) / diamondTargetTotal).toFixed(2)) * 100
                                    if (item.recitePCT > 100)item.recitePCT = 100;
                                    item.mixed = item.mixed > 0 ? item.mixed : targetNUMSet;
                                    item.mixedPCT = ((parseFloat(item.mixed) / diamondTargetTotal).toFixed(2)) * 100
                                    if (item.mixedPCT > 100)item.mixedPCT = 100;
                                    item.recite2 = item.recite2 > 0 ? item.recite2 : targetNUMSet;
                                    item.recitePCT2 = ((parseFloat(item.recite2) / diamondTargetTotal).toFixed(2)) * 100
                                    if (item.recitePCT2 > 100)item.recitePCT2 = 100;
                                    item.mixed2 = item.mixed2 > 0 ? item.mixed2 : targetNUMSet;
                                    item.mixedPCT2 = ((parseFloat(item.mixed2) / diamondTargetTotal).toFixed(2)) * 100
                                    if (item.mixedPCT2 > 100)item.mixedPCT2 = 100;
                                    break;
                            }

                        });


                        elem.find('.tab1').html(rk.templateText(require('oa/tmpl/wanxue/tpl_marking_report_detail_capability.tpl'), data));

                        $.each(data, function (key, item) {
                            switch (key) {
                                case 'recruit':
                                case 'member':
                                case 'lecture':
                                case 'pro':
                                case 'train':
                                case 'pub':
                                case 'internet':
                                case 'capability':
                                case 'wxt':
                                    var tipHTML = '   <div style="width: 180px;" data-id="span_content_tip"><div class="visit-tip-content">' +
                                        '<div class="tip-des"><span class="tip-title">流程与话术背诵：' + (item.recite != 0 ? (item.recite + '分') : '未设置') + '</span></div>' +
                                        '<div  class="tip-des"><span class="tip-title">流程与话术综合运用：' + (item.mixed != 0 ? (item.mixed + '分') : '未设置') + '</span></div>' +
                                        '<div  class="tip-des"><span class="tip-title">培训人：' + item.trainer + '</span></div>' +
                                        '<div  class="tip-des"><span class="tip-title">考核人：' + item.approver + '</span></div></div></div>';
                                    elem.find('td[data-id="' + key + '"]').beTip({
                                        title: tipHTML,
                                        dir: 'top',
                                        closeDelay: false
                                    });//设置新的tip文字
                                    break;
                                case 'diamond':
                                    var tipHTML = '   <div style="width: 180px;" data-id="span_content_tip"><div class="visit-tip-content">' +
                                        '<div class="tip-des"><span class="tip-title">' + '激发流程与话术背诵：' + (item.recite != 0 ? (item.recite + '分') : '未设置') + '</span></div>' +
                                        '<div  class="tip-des"><span class="tip-title">' + '激发流程与话术综合运用：' + (item.mixed != 0 ? (item.mixed + '分') : '未设置') + '</span></div>' +
                                        '<div class="tip-des"><span class="tip-title">' + '咨询流程与话术背诵：' + (item.recite2 != 0 ? (item.recite2 + '分') : '未设置') + '</span></div>' +
                                        '<div  class="tip-des"><span class="tip-title">' + '咨询流程与话术综合运用：' + (item.mixed2 != 0 ? (item.mixed2 + '分') : '未设置') + '</span></div>' +
                                        '<div  class="tip-des"><span class="tip-title">' + '培训人：' + item.trainer + '</span></div>' +
                                        '<div  class="tip-des"><span class="tip-title">' + '考核人：' + item.approver + '</span></div></div></div>';
                                    elem.find('td[data-id="diamond"]').beTip({
                                        title: tipHTML,
                                        dir: 'top',
                                        closeDelay: false
                                    });//设置新的tip文字
                                    break;
                            }

                        });


                    } else if (data.status === 300002) {
                        var _content = '<div class="default_page"><div class="ico"></div><p>' + me.data.userName + ' 的业务能力没有设置' + '</p></div>';
                        elem.find('.tab1').html(_content);
                    }
                });


            });

            $('#business_work').on('click', function (event) {
                var $this = $(this);
                event.preventDefault();
                $this.addClass('active').siblings().removeClass('active');
                elem.find('.tab1').hide();
                var currentYear = new Date().getFullYear();
                var currentMonth = new Date().getMonth();
                var yearHTML = ' <select id="selectedYear">';
                var monthHTML = '<select id="selectedMonth">';

                for (var m = 1; m <= 12; m++) {
                    var selected = (m == currentMonth) ? 'selected' : '';
                    monthHTML += '<option ' + selected + '  value="' + m + '">' + m + '月</option>';
                }
                monthHTML += '</select>'

                for (var y = 2010; y <= 2030; y++) {
                    var selected = (y == currentYear) ? 'selected' : '';
                    yearHTML += '<option ' + selected + ' value="' + y + '">' + y + '年</option>';
                }
                yearHTML += '</select>'

                var data = {};
                data.selectYears = yearHTML;
                data.selectMonth = monthHTML;
                elem.find('.tab2').html(rk.templateText(require('oa/tmpl/wanxue/tpl_marking_report_detail_work.tpl'), data)).show();

                elem.find('.wx-data-text-content span.wx-data-ico').hide();
                elem.find('.wx-data-text-content span.wx-data-text').html(currentYear + '年');
                elem.find('.wx-data-text-content').attr('data-year', currentYear).addClass('data-selected');
                $(".wx-detail-tab2-header span.ui-select-buttonset select").selectmenu({
                    change: function (event, ui) {
                        var val = ui.item.value;
                        if (val == '1') {
                            var currentYear = new Date().getFullYear();
                            elem.find('.wx-data-text-content span.wx-data-ico').hide();
                            elem.find('.wx-data-text-content span.wx-data-text').html(currentYear + '年');
                            elem.find('.wx-data-text-content').addClass('data-selected').attr('data-select', val);
                            me._search();
                        } else if (val == '2') {
                            elem.find('.wx-data-text-content span.wx-data-ico').show();
                            elem.find('.wx-data-text-content span.wx-data-text').html('请选择');
                            elem.find('.wx-data-text-content').removeClass('data-selected').attr('data-select', val);
                        }

                    }
                });

                $(".wx-detail-tab2-header .wx-data-selectmenu select").selectmenu({
                    appendTo: elem.find('.data-selectmenu-dialogCon')
                });


                elem.find('.wx-data-text-content').toggle(function (event) {
                    var $this = $(this);
                    $this.attr("randomkey", opt.randomkey);
                    event.preventDefault();
                    if (elem.find('.wx-data-text-content').attr('data-select') == '2') {
                        elem.find('.data-selectmenu-dialogCon').show();
                        me._registerToBodyClick();
                    }


                }, function (event) {
                    var $this = $(this);
                    event.preventDefault();
                    if (elem.find('.wx-data-text-content').attr('data-select') == '2') {
                        elem.find('.data-selectmenu-dialogCon').hide();
                    }


                });
                elem.find('.wx-data-selectmenu a.green_button').on('click', function (event) {
                    var $this = $(this);
                    event.preventDefault();
                    var year = $('#selectedYear').val();
                    var month = $('#selectedMonth').val();
                    elem.find('.wx-data-text-content').attr('data-year', year);
                    elem.find('.wx-data-text-content').attr('data-month', month);
                    elem.find('.wx-data-text-content span.wx-data-text').html(year + '年' + month + '月');
                    elem.find('.data-selectmenu-dialogCon').hide();
                    me._search();
                });

                me._search();
            });


        },

        _registerToBodyClick: function () {
            var me = this;
            var elem = me.element;
            var opt = me.options;

            $(document.body).on('click.' + opt.randomkey, function (e) {
                var elemMenu = elem.find('.data-selectmenu-dialogCon')[0];
                var target = $(e.target);
                if (!$.contains(elemMenu, e.target) && elemMenu != e.target) {
                    window.setTimeout(function () {
                        $(document.body).off('click.' + opt.randomkey);
                        elem.find('.data-selectmenu-dialogCon').hide()
                    }, 10);
                }
                if ($(target).parents().attr('randomkey') == opt.randomkey || target.attr('randomkey') == opt.randomkey) {
                    return;
                }

            });
        },

        _search: function () {
            var me = this,
                elem = this.element,
                opt = this.options;

            $('#business_work_content').beLoading({
                size: 'large'
            })
            var selectMonth = elem.find('.wx-data-text-content').attr('data-month');
            var selectYear = elem.find('.wx-data-text-content').attr('data-year');
            var selectType = elem.find('.wx-data-text-content').attr('data-select');
            var userId = me.data.customerId;

            rk.get('/json/crm_wanxue/work-report.action', {
                uid: userId,
                type: selectType,
                month: selectMonth,
                year: selectYear
            }, function (data) {
                if (data.status === 0) {
                    data = data.data.work;

                    $.each(data, function (key, item) {
                        if (key != 'agent') {
                            item.PCT = item.target ? Math.round(((parseFloat(item.actual) / parseFloat(item.target)).toFixed(2)) * 100) : 0;
                            if (item.PCT > 100)item.PCT = 100;
                        } else {
                            item.PCT = item.target ? Math.round(((parseFloat(item.actual) / parseFloat(item.target)).toFixed(2)) * 100) : 0;
                            if (item.PCT > 100)item.PCT = 100;
                            item.comletedPCT = item.actual ? Math.round(((parseFloat(item.completed) / parseFloat(item.actual)).toFixed(2)) * 100) : 0;
                            if (item.comletedPCT > 100)item.comletedPCT = 100;
                        }
                    });
                    $('#business_work_content').html(rk.templateText(require('oa/tmpl/wanxue/tpl_marking_report_detail_work_content.tpl'), data));
                    elem.find('td > a').on('click', function (event) {
                        var $this = $(this);
                        $this.parent().siblings().find('a').removeClass('active');
                        $this.parent().parent().siblings().find('a').removeClass('active');
                        $this.addClass('active');
                        event.preventDefault();

                        var targetName = $this.attr('data-id');

                        var target = $this.attr('data-target');
                        var actual = $this.attr('data-actual');
                        var train = $this.attr('data-train');
                        var recruit = $this.attr('data-recruit');
                        var completed = $this.attr('data-completed');
                        var selectId = $this.attr('data-value');
                        var pct = $this.attr('data-pct');


                        var selectMonth = elem.find('.wx-data-text-content').attr('data-month');
                        var selectYear = elem.find('.wx-data-text-content').attr('data-year');
                        var selectType = elem.find('.wx-data-text-content').attr('data-select');
                        var userId = me.data.customerId;
                        var title = me.data.userName + ' - ' + $this.html();
                        rk.dialog({
                            title: title,
                            width: 970,
                            success: function (contentElem, footerElem) {
                                if (targetName == 'agent') {
                                    rk.get('/json/crm_wanxue/pop-agent-detail.action',
                                        {
                                            uid: userId,
                                            type: selectType,
                                            month: selectMonth,
                                            seletId: selectMonth,
                                            year: selectYear
                                        }, function (data) {
                                            if (data.status === 0) {
                                                data = data.data.results;
                                                var tbodyHTML = '';

                                                var cellData = {};

                                                $.each(data, function (key, content) {
                                                    cellData[key] = {};
                                                    $.each(content, function (subkey, item) {
                                                        if (subkey == 'content') {
                                                            $.each(item[key], function (itemKey, itemValue) {
                                                                cellData[key][itemKey] = itemValue
                                                            });
                                                        } else if (subkey == 'children') {
                                                            if (!$.isEmptyObject(item)) {
                                                                cellData[key]['hasChildren'] = true;
                                                                cellData[key]['children'] = item;
                                                            }

                                                        }
                                                    });
                                                });

                                                $.each(cellData, function (key, item) {
                                                    var hasChildrenClass = item.hasChildren ? 'title' : '';

                                                    var pct = item.target ? Math.round(((parseFloat(item.actual) / parseFloat(item.target)).toFixed(2)) * 100) : 0;
                                                    if (pct > 100)pct = 100;

                                                    var completedPct = item.actual ? Math.round(((parseFloat(item.completed) / parseFloat(item.actual)).toFixed(2)) * 100) : 0;
                                                    if (completedPct > 100)completedPct = 100;
                                                    var rowHTML = '<tr><td><a data-content-id="' + key + '" href="javascript:void(0);" class="' + hasChildrenClass + '">' + item.name + '</a></td><td>' + item.target + '人</td><td>' + item.actual + '人</td><td>' + pct + '%</td><td>' + item.completed + '人</td><td>' + completedPct + '%</td></tr>';
                                                    if (!item.hasChildren) {
                                                        rowHTML = '<tr><td><span>' + item.name + '</span></td><td>' + item.target + '人</td><td>' + item.actual + '人</td><td>' + pct + '%</td><td>' + item.completed + '人</td><td>' + completedPct + '%</td></tr>';
                                                    }

                                                    if (item.hasChildren) {
                                                        var subHTML = '<tr  id=sub_' + key + ' hidden><td colspan="6"><table  class="subtable" cellpadding="0" cellspacing="0"><tbody>';
                                                        var subTr = '';
                                                        $.each(item.children, function (childKey, childItem) {
                                                            var subPct = childItem.target ? ((parseFloat(childItem.actual) / parseFloat(childItem.target)).toFixed(2) * 100) : 0;
                                                            if (subPct > 100)subPct = 100;
                                                            var subCompletedPct = childItem.target ? ((parseFloat(childItem.completed) / parseFloat(childItem.target)).toFixed(2) * 100) : 0;
                                                            if (subCompletedPct > 100)subCompletedPct = 100;
                                                            subTr += '<tr><td>' + childItem.name + '</td><td>' + childItem.target + '人</td><td>' + childItem.actual + '人</td><td>' + subPct + '%</td><td>' + childItem.completed + '人</td><td>' + subCompletedPct + '%</td></tr>';
                                                        });
                                                        subHTML += subTr + '</tbody></table></td></tr>';
                                                        rowHTML += subHTML;
                                                    }
                                                    tbodyHTML += rowHTML;

                                                });

                                                data.tbodyHTML = tbodyHTML;
                                                var tfootHTML = '<tr><td><span class="count">总计</span></td><td>' + target + '人</td><td>' + actual + '人</td><td>' + recruit + '%</td><td>' + completed + '人</td><td>' + train + '%</td></tr>';
                                                data.tfootHTML = tfootHTML;
                                                contentElem.html(rk.templateText(require('oa/tmpl/wanxue/tpl_marking_report_detail_popup_agent.tpl'), data));
                                                rk.repositionDialog();
                                                contentElem.find('.wx-table-body a.title').toggle(function (event) {
                                                    var $this = $(this);
                                                    $this.addClass('active');
                                                    event.preventDefault();
                                                    var cellID = $this.attr('data-content-id');
                                                    contentElem.find('#sub_' + cellID).show();
                                                    rk.repositionDialog();
                                                }, function (event) {
                                                    var $this = $(this);
                                                    $this.removeClass('active');
                                                    event.preventDefault();
                                                    var cellID = $this.attr('data-content-id');
                                                    contentElem.find('#sub_' + cellID).hide();
                                                    rk.repositionDialog();
                                                });

                                            }
                                        });


                                } else if (targetName == 'product') {
                                    rk.get('/json/crm_wanxue/pop-product-detail.action',
                                        {
                                            uid: userId,
                                            type: selectType,
                                            month: selectMonth,
                                            selectId: selectId,
                                            year: selectYear
                                        }, function (data) {
                                            if (data.status === 0) {
                                                data = data.data.results;
                                                var tbodyHTML = '';

                                                $.each(data, function (key, item) {
                                                    item.hasChildren = item.sub && item.sub.length!=0;
                                                    var hasChildrenClass = item.hasChildren ? 'title' : '';
                                                    var pct = item.target ? Math.round(((parseFloat(item.actual) / parseFloat(item.target)).toFixed(2)) * 100) : 0;
                                                    if (pct > 100)pct = 100;
                                                    var rowHTML = '<tr><td><a data-content-id="' + key + '" href="javascript:void(0);" class="' + hasChildrenClass + '">' + item.name + '</a></td><td>' + item.target + '人</td><td>' + item.actual + '人</td><td>' + pct + '%</td></tr>'
                                                    if (!item.hasChildren) {
                                                        rowHTML = '<tr><td><span>' + item.name + '</span></td><td>' + item.target + '人</td><td>' + item.actual + '人</td><td>' + pct + '%</td></tr>';
                                                    }

                                                    if (item.hasChildren) {
                                                        var subHTML = '<tr  id=sub_' + key + ' hidden><td colspan="6"><table  class="subtable" cellpadding="0" cellspacing="0"><tbody>';
                                                        var subTr = '';
                                                        $.each(item.sub, function (childKey, childItem) {
                                                            var subPct = childItem.target ? (parseFloat(childItem.actual / childItem.target).toFixed(2) * 100) : 0;
                                                            if (subPct > 100)subPct = 100;
                                                            subTr += '<tr><td>' + childItem.name + '</td><td>' + childItem.target + '人</td><td>' + childItem.actual + '人</td><td>' + subPct + '%</td></tr>';
                                                        });
                                                        subHTML += subTr + '</tbody></table></td></tr>';
                                                        rowHTML += subHTML;
                                                    }
                                                    tbodyHTML += rowHTML;

                                                });

                                                data.tbodyHTML = tbodyHTML;



                                                var tfootHTML = '<tr><td><span class="count">总计</span></td><td>' + target + '人</td><td>' + actual + '人</td><td>' + pct + '%</td></tr>';
                                                data.tfootHTML = tfootHTML;
                                                contentElem.html(rk.templateText(require('oa/tmpl/wanxue/tpl_marking_report_detail_popup_common.tpl'), data));
                                                rk.repositionDialog();
                                                contentElem.find('.wx-table-body a.title').toggle(function (event) {
                                                    var $this = $(this);
                                                    $this.addClass('active');
                                                    event.preventDefault();
                                                    var cellID = $this.attr('data-content-id');
                                                    contentElem.find('#sub_' + cellID).show();
                                                }, function (event) {
                                                    var $this = $(this);
                                                    $this.removeClass('active');
                                                    event.preventDefault();
                                                    var cellID = $this.attr('data-content-id');
                                                    contentElem.find('#sub_' + cellID).hide();
                                                });

                                            }
                                        });


                                } else {
                                    rk.get('/json/crm_wanxue/pop-' + targetName + '-detail.action',
                                        {
                                            uid: userId,
                                            type: selectType,
                                            month: selectMonth,
                                            selectId: selectId,
                                            year: selectYear
                                        }, function (data) {
                                            if (data.status === 0) {
                                                data = data.data.results;
                                                var tbodyHTML = '';

                                                var cellData = {};

                                                $.each(data, function (key, content) {
                                                    cellData[key] = {};
                                                    $.each(content, function (subkey, item) {
                                                        if (subkey == 'content') {
                                                            $.each(item[key], function (itemKey, itemValue) {
                                                                cellData[key][itemKey] = itemValue
                                                            });
                                                        } else if (subkey == 'children') {
                                                            if (!$.isEmptyObject(item)) {
                                                                cellData[key]['hasChildren'] = true;
                                                                cellData[key]['children'] = item;
                                                            }

                                                        }
                                                    });
                                                });

                                                $.each(cellData, function (key, item) {
                                                    var hasChildrenClass = item.hasChildren ? 'title' : '';
                                                    var pct = item.target ? Math.round(((parseFloat(item.actual) / parseFloat(item.target)).toFixed(2)) * 100) : 0;
                                                    if (pct > 100)pct = 100;
                                                    var rowHTML = '<tr><td><a data-content-id="' + key + '" href="javascript:void(0);" class="' + hasChildrenClass + '">' + item.name + '</a></td><td>' + item.target + '人</td><td>' + item.actual + '人</td><td>' + pct + '%</td></tr>'
                                                    if (!item.hasChildren) {
                                                        rowHTML = '<tr><td><span>' + item.name + '</span></td><td>' + item.target + '人</td><td>' + item.actual + '人</td><td>' + pct + '%</td></tr>';
                                                    }
                                                    if (item.hasChildren) {
                                                        var subHTML = '<tr  id=sub_' + key + ' hidden><td colspan="6"><table  class="subtable" cellpadding="0" cellspacing="0"><tbody>';
                                                        var subTr = '';
                                                        $.each(item.children, function (childKey, childItem) {
                                                            var subPct = childItem.target ? (parseFloat(childItem.actual / childItem.target).toFixed(2) * 100) : 0;
                                                            if (subPct > 100)subPct = 100;
                                                            subTr += '<tr><td>' + childItem.name + '</td><td>' + childItem.target + '人</td><td>' + childItem.actual + '人</td><td>' + subPct + '%</td></tr>';
                                                        });
                                                        subHTML += subTr + '</tbody></table></td></tr>';
                                                        rowHTML += subHTML;
                                                    }
                                                    tbodyHTML += rowHTML;

                                                });

                                                data.tbodyHTML = tbodyHTML;
                                                var tfootHTML = '<tr><td><span class="count">总计</span></td><td>' + target + '人</td><td>' + actual + '人</td><td>' + pct + '%</td></tr>';
                                                data.tfootHTML = tfootHTML;
                                                contentElem.html(rk.templateText(require('oa/tmpl/wanxue/tpl_marking_report_detail_popup_common.tpl'), data));
                                                rk.repositionDialog();
                                                contentElem.find('.wx-table-body a.title').toggle(function (event) {
                                                    var $this = $(this);
                                                    $this.addClass('active');
                                                    event.preventDefault();
                                                    var cellID = $this.attr('data-content-id');
                                                    contentElem.find('#sub_' + cellID).show();
                                                }, function (event) {
                                                    var $this = $(this);
                                                    $this.removeClass('active');
                                                    event.preventDefault();
                                                    var cellID = $this.attr('data-content-id');
                                                    contentElem.find('#sub_' + cellID).hide();
                                                });

                                            }
                                        });

                                }
                            },
                            footer: false
                        });


                    });
                }
            });


        },

        _init: function () {
            var $this = this,
                $elem = this.element,
                opt = this.options;

            //根据opt确定参数

            var titleDATA = {};
            titleDATA.customerId = opt.target.attr("customerid");
            titleDATA.departId = opt.target.attr("departId");
            titleDATA.actualTarget = opt.target.attr("actualTarget");
            titleDATA.performanceTarget = opt.target.attr("performanceTarget");
            titleDATA.departName = opt.target.attr("departName");
            titleDATA.joinAt = opt.target.attr("joinAt") ? opt.target.attr("joinAt") : '暂无';
            titleDATA.starLevel = opt.target.attr("starLevel");
            titleDATA.percentage = opt.target.attr("percentage");
            titleDATA.userIcon = opt.target.attr("userIcon") ? opt.target.attr("userIcon") : rk.DEFAULT_USER_ICON;
            titleDATA.userName = opt.target.attr("userName");
            titleDATA.gender = opt.target.attr("gender");

            $this.data = titleDATA;
            $this._render(titleDATA);
            $this._bind();
            $('#business_capability').trigger('click');

        },

    });
    return {
        init: function (rkContent, id) {
            rkContent.markingReportDetail();
        }
    }
});